﻿/*
 * PsTFS is a set of PowerShell commands to manage and use Team Foundation Server. PowerShell 
 * effectiveness is combined with the power of TFS API to maximizes TFS capabilities.
 * 
 * Creator : Choulant Noham
 * Mail : choulant@gmail.com
 * Blog : http://choulant.blogspot.com
 * 
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Management.Automation;
using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.VersionControl.Client;
using System.Collections;
using Microsoft.TeamFoundation.Server;
using Microsoft.TeamFoundation.WorkItemTracking.Client;
using PowerShell.Host.PsTFS.CdmLet.PsObject;
using Microsoft.SharePoint;

namespace PowerShell.Host.PsTFS.CdmLet
{
    /// <summary>
    /// Liste des membres d'un projet
    /// </summary>
    [Cmdlet(VerbsCommon.Get, "ProjectMember")]
    public class Get_ProjectMember : Cmdlet
    {
        protected override void ProcessRecord()
        {
            List<PsGroups> lg = new List<PsGroups>();

            lg = PsMethode.GetMembersProject(TFS, ProjectName);

            //Retourne la liste
            WriteObject(lg);
        }


        /// <summary>
        /// Permet d'informer la fin de la commande
        /// </summary>
        protected override void EndProcessing()
        {
            PsLog.AddLog(null, "GetProjectMember is end");
            base.EndProcessing();
        }

        [Parameter(Position = 0, Mandatory = true)]
        [ValidateNotNullOrEmpty]
        public TeamFoundationServer TFS { get; set; }

        [Parameter(Position = 1, Mandatory = true)]
        [ValidateNotNullOrEmpty]
        public string ProjectName { get; set; }
    }
}


